package com.gsoe.auth.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gsoe.auth.po.Class;
import com.gsoe.auth.vo.ClassVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 班级表 Mapper 接口
 * </p>
 *
 * @author xiaoma
 * @since 2024-12-14
 */
public interface ClassMapper extends BaseMapper<Class> {


    @Select("select c.* from class as c " +
            "inner join user_class as uc on c.id = uc.class_id " +
            "where uc.user_id=#{userId} and c.class_name like concat('%',#{input},'%')")
    List<ClassVO> getUserClass(@Param("userId") Long userId, @Param("input") String input);
}
